//
//  LZSegmentView.h
//  FastCall
//
//  Created by Carlson Lee on 2017/12/8.
//  Copyright © 2017年 XiaoNiu Ltd. All rights reserved.

//  此类用于重写多页面滑动的基类

#import <UIKit/UIKit.h>

@protocol FCSegmentViewDelegate;
@interface FCSegmentView : UIView

@property (nonatomic, assign) id<FCSegmentViewDelegate> delegate;

//默认选中第一个标签
@property (nonatomic, assign) NSInteger index;

//标签颜色和大小
@property (nonatomic, strong) UIColor* tagColor;
@property (nonatomic, strong) UIColor* tagSelectColor;
@property (nonatomic, strong) UIFont* tagFont;
//默认1.0
@property (nonatomic, assign) CGFloat selectScale;

//标签线
@property (nonatomic, strong) UIView* tagLine;
//标签线颜色
@property (nonatomic, strong) UIColor* lineColor;
//标签线大小
@property (nonatomic, assign) CGSize lineSize;
//标签线是否隐藏
@property (nonatomic, assign) BOOL isLineHidden;

//标签的总长度
@property (nonatomic, assign) CGFloat tagsWidth;
//标签偏移量：x横向偏移，y纵向偏移
@property (nonatomic, assign) CGPoint tagsOffset;

//标签对象数组
@property (nonatomic, strong) NSArray* items;

- (instancetype)initWithColor:(UIColor* )color selectColor:(UIColor* )sColor font:(UIFont* )font;

//设置标签数组和默认选中标签
- (void)setTags:(NSArray* )tags atIndex:(NSInteger )index;

//segment偏移算法, 子类需重写该方法
- (void)segmentScrollContentOffset:(CGFloat )offsetX;

//选中标签
- (void)selectWithTag:(NSInteger )tag;

@end

@protocol FCSegmentViewDelegate <NSObject>

//选中index标签
- (void)segmentSelectWithTag:(NSInteger )index;

@end
